using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace TankWars.Weapons
{
    class Missile : Shot
    {
        private const int N_MISSILE_POWER = 15;
        public const int N_TIME_BETWEEN_FIRING = 1200;
        public const int N_MAX_AMMO = 10;
        public const WeaponManager.WeaponCategory SHOT_CATEGORY = WeaponManager.WeaponCategory.Ammo;

        private float fSpeed = 190.0f;

        public Missile(Tank firingTank, Texture2D missileSprite)
        {
            base.FiringTank = firingTank;

            base.Sprite = missileSprite;

            base.nPower = N_MISSILE_POWER;

            //Set the position and rotation of the missle to the tank.
            base.fRotation = firingTank.Rotation;
            base.vPosition = firingTank.vPosition;

            //Set the speed of the missle relative to its rotation.
            base.vSpeed.X = (float)(this.fSpeed*Math.Cos(base.fRotation));
            base.vSpeed.Y = (float)(this.fSpeed*Math.Sin(base.fRotation));
        }
    }

    class CopyOfMissile : Shot
    {
        private const int N_MISSILE_POWER = 15;
        public const int N_TIME_BETWEEN_FIRING = 1200;
        public const int N_MAX_AMMO = 10;
        public const WeaponManager.WeaponCategory SHOT_CATEGORY = WeaponManager.WeaponCategory.Ammo;

        private float fSpeed = 190.0f;

        public CopyOfMissile(Tank firingTank, Texture2D missileSprite)
        {
            base.FiringTank = firingTank;

            base.Sprite = missileSprite;

            base.nPower = N_MISSILE_POWER;

            //Set the position and rotation of the missle to the tank.
            base.fRotation = firingTank.Rotation;
            base.vPosition = firingTank.vPosition;

            //Set the speed of the missle relative to its rotation.
            base.vSpeed.X = (float)(this.fSpeed * Math.Cos(base.fRotation));
            base.vSpeed.Y = (float)(this.fSpeed * Math.Sin(base.fRotation));
        }
    }
}
